package com.jg.xmlSchema2JsonSchema.xsd;

import com.jg.xmlSchema2JsonSchema.xsd.util.XsdUtil;
import org.w3c.dom.Element;

public class XsSimpleType {

	private String name;
	private Element element;
	private String annotation;
	private String id;
	public XsSimpleType(Element element)
	{
		this.element=element;
		getData();
	}
	private void getData()
	{
		XsAnnotation xsAnnotation= XsdUtil.getAnnotation(element);
		if(xsAnnotation!=null)
			annotation=xsAnnotation.getText();
		id=element.getAttribute("id");
		name=element.getAttribute("name");
	}
	public String getAnnotation()
	{
		return annotation;
	}
	
	public String getName() {
		return name;
	}
	public String getId()
	{
		return id;
	}
	public XsRestriction getRestriction()
	{
		return XsdUtil.getRestriction(element);
	}
	public Element getXmlElement()
	{
		return element;
	}
}
